<template>
	<view class='fix-bottom-nav'>
		<view class='fix-item' @click="toTabPage(1)">
			<image src="/static/icon/index.png" mode=""></image>
			<view class='fix-title'>首页</view>
		</view>
		<view class='fix-item' @click='toTabPage(2)'>
			<image src="/static/tabbar/images/a2.png" mode=""></image>
			<view class='fix-title'>求购</view>
		</view>
		<view class='fix-item' @click='toTabPage(3)'>
			<image src="/static/tabbar/images/a3.png" mode=""></image>
			<view class='fix-title'>供应</view>
		</view>
		<view class='fix-item' @click='toTabPage(4)'>
			<image src="/static/tabbar/images/a4.png" mode=""></image>
			<view class='fix-title'>色胚</view>
		</view>
		<view class='fix-item' @click='toTabPage(5)'>
			<image src="/static/icon/home.png" mode=""></image>
			<view class='fix-title'>我的</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods:{
			//模拟tabbar 跳转到对应页面
			toTabPage(e) {
				let url = '';
				switch (e) {
					case 1:
						url = '/pages/tabbar/gy/gy'
						break;
					case 2:
						url = '/pages/tabbar/qg/qg'
						break;
					case 3:
						url = '/pages/tabbar/rz/rz'
						break;
					case 4:
						url = '/pages/tabbar/sp/sp'
						break;
					case 5:
						url = '/pages/tabbar/jx/jx'
						break;
					default:
				}
			
				if (url) {
					uni.switchTab({
						url
					})
				}
			},
		}
	}
</script>

<style>
	.fix-bottom-nav {
		width: 100%;
		line-height: 30upx;
		border-top: 1px solid #A1A1A1;
		position: fixed;
		bottom: 0upx;
		display: flex;
		align-items: center;
		justify-content: space-around;
		background: #FFF;
		padding: 20upx 0;
	}

	.fix-item {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column
	}

	.fix-item image {
		width: 50upx;
		height: 50upx;
	}

	.fix-title {
		color: #C8C8C8;
		font-size: 12px;
	}
</style>
